Skip to content

feat: implement Phase 2 — worker pool, backoff strategies, and retry fix#2

Merged
reckziegelwilliam merged 1 commit intomainfrom
phase-2-worker-pool-execution
Apr 1, 2026
Merged

feat: implement Phase 2 — worker pool, backoff strategies, and retry fix#2
reckziegelwilliam merged 1 commit intomainfrom
phase-2-worker-pool-execution

Conversation

@reckziegelwilliam
Copy link
Copy Markdown
Owner

Core changes:

  • Add internal/worker package: Handler registry, BackoffStrategy interface, FixedBackoff, ExponentialBackoff, Worker (single consumer), Pool (multi-queue multi-worker orchestrator) with graceful shutdown and per-worker state snapshots
  • Fix retry bug in both backends: Nack previously set non-final failures to "failed" status, which Reserve never picks up (it only selects "pending" jobs). Non-final failures now go back to "pending" with scheduled_at = now + retryDelay
  • Extend Backend.Nack signature to accept retryDelay time.Duration so the worker can pass its computed backoff to the backend atomically
  • Update all backend tests to use the new Nack signature and assert "pending" status (not "failed") for retryable jobs
  • Mark Phase 2 complete in PLAN.md

Core changes:
- Add internal/worker package: Handler registry, BackoffStrategy interface,
  FixedBackoff, ExponentialBackoff, Worker (single consumer), Pool (multi-queue
  multi-worker orchestrator) with graceful shutdown and per-worker state snapshots
- Fix retry bug in both backends: Nack previously set non-final failures to
  "failed" status, which Reserve never picks up (it only selects "pending" jobs).
  Non-final failures now go back to "pending" with scheduled_at = now + retryDelay
- Extend Backend.Nack signature to accept retryDelay time.Duration so the worker
  can pass its computed backoff to the backend atomically
- Update all backend tests to use the new Nack signature and assert "pending"
  status (not "failed") for retryable jobs
- Mark Phase 2 complete in PLAN.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@reckziegelwilliam reckziegelwilliam merged commit 3681262 into main Apr 1, 2026
3 of 5 checks passed
@reckziegelwilliam reckziegelwilliam deleted the phase-2-worker-pool-execution branch April 1, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant